Field of the Invention
Embodiments of the present invention generally relate to task management, and more specifically to affinity load balancing.
Description of the Related Art
Energy management requires a significant amount of interaction with devices, such as smart meters in order to perform types of tasks, such as meter reads, firmware upgrades, and the like. Customers, such as energy providers (e.g., an electric utility) request information from the devices via a task management service. A cluster of servers may be used to spread the workload of processing incoming task requests.
For example, a first task request may be received from an energy provider on server1, requesting a meter read of deviceA for a specified period of time. At the same time, a second task request may be received from a development group on server2, requesting a firmware upgrade of deviceA. If server1 accepts the first task, then server1 is said to have acquired an affinity for the task type of meter read. If server2 accepts the second task request, then server2 is said to have acquired an affinity for the task type of firmware upgrade. Going forward, server1 accepts all tasks of task type meter read. However, there is no mechanism in place to prevent single server to become overloaded by different affinity. As such, a server could acquire many affinities in the cluster while other servers are idle. This scenario causes system resources to slow down because all resources to process the tasks are being limited to the resources available on the single server.
Therefore, there is a need for a method and apparatus for affinity load balancing.